<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>Floor View</title>
  <script src="/js/jquery.min.js"></script>
  <script src="/js/websocket.js"></script>

  <script src="/js/sockjs.min.js"></script>
  <script src="/js/stomp.min.js"></script>
  <script id="code">
      var DEBUG_FLAG = true;
      $(function()
      {
          //启动websocket
          connect();
      });

      function send() {
        var msg = $("#msg").val();
        stompClient.send("/app/send", {}, msg);
      }

      function sendToUser() {
        var msg = $("#msg").val();
        var toUserId = $("#userId").val();
        var data  = {"fromUserId": userId, "toUserId": toUserId, "msg": msg};
        stompClient.send("/app/sendToUser", {}, JSON.stringify(data));
      }
  </script>
</head>

<body style="margin: 0px;padding: 0px;overflow: hidden; ">
  <!-- 显示消息-->
  <textarea id="debuggerInfo" style="width:100%;height:200px;"></textarea>
  <!-- 发送消息-->
  <div>用户：<input type="text" id="userId"></input></div>
  <div>消息：<input type="text" id="msg"></input></div>
  <div><input type="button" value="发送消息" onclick="sendToUser()"></input></div>
</body>
</html>